home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / Prograph Reference Manual.sit / Prograph Reference Manual / Prograph Reference 8-End.rsrc / TEXT_141.txt < prev    next >
Text File  |  1995-10-26  |  23KB  |  720 lines

  1.  
  2. t    Datafile Manager Primitives Descriptions *494*
  3.  
  4.  
  5. _________________________________________________
  6. ツ 
  7.                           cluster-delete     *494*
  8.  
  9.  
  10. Input names: Table ID; Cluster ID; [ Key Values]
  11.  
  12. Input types: integer; integer; [list]
  13.  
  14. Output types: integer
  15.  
  16. Description:  Flags a cluster as deleted. The cluster is then inaccessible by other Prograph datafile primitives. If db-compact is performed, the space for the cluster is recovered. If a cluster is already deleted or the cluster ID is invalid, then a 窶彡luster does not exist窶 error is returned. Clusters may not be deleted in query mode else a mode (4) error is returned.
  17.  
  18.  If a Key Values list is provided, the appropriate key-cluster associations are deleted. Key values are specified in sorted order of key names. If any of the keys do not exist, a 窶彡luster does not exist窶 error is returned. If NULL is specified as a key value it will be ignored.
  19.  
  20.  
  21. _________________________________________________
  22. ツ 
  23.                                           cluster-first     *495*
  24.  
  25.  
  26. Input types: integer; boolean
  27.  
  28. Output types: integer; integer
  29.  
  30. Description: Returns the Cluster ID of the first cluster in the datafile.  If Active is TRUE the ID of the first active cluster is returned, otherwise the ID of the first deleted cluster is returned.
  31.  
  32.  
  33. _________________________________________________
  34. ツ 
  35.                                           cluster-lock     *495*
  36.  
  37.  
  38. Input types: integer; integer
  39.  
  40. Output types: integer
  41.  
  42. Description:  Prevents other applications using the data file from reading, replacing, or deleting the specified cluster. Clusters may only be locked in share mode else a mode (4) error is returned.
  43.  
  44.  
  45. _________________________________________________
  46. ツ 
  47.  
  48.                                                         cluster-next    *496*
  49.  
  50. Input types: integer; integer; boolean
  51.  
  52. Output types: integer; integer
  53.  
  54. Description: Returns the Cluster ID of the next cluster in the datafile after StartingClusterID.  If Active is TRUE the ID of the next active cluster is returned, otherwise the ID of the next deleted cluster is returned.
  55.  
  56.  
  57. _________________________________________________
  58. ツ 
  59.                                     cluster-read     *496*
  60.  
  61.  
  62. Input types: integer; integer
  63.  
  64. Output types: integer; any
  65.  
  66. Description:  Reads the cluster with the specified cluster ID from the table. If the cluster has been deleted or if the cluster ID is invalid, then a 窶彡luster does not exist窶 (10) error is returned. 窶廸ame not in class map窶 (3) error may be returned.
  67.  
  68.  
  69. _________________________________________________
  70. ツ 
  71.                                       cluster-read-db    *496*
  72.  
  73.  
  74. Input types: integer; integer
  75.  
  76. Output types:    integer; any
  77.  
  78. Description: Reads the cluster specified by ClusterId.
  79.  
  80.  
  81. _________________________________________________
  82. ツ 
  83.                                                 cluster-replace     *497*
  84.  
  85.  
  86.  
  87. Input names: Table ID; Old Cluster ID; Value; [Old Key Values; New Key Values]
  88.  
  89. Input types: integer; integer; any; [list; list]
  90.  
  91. Output types: integer; integer
  92.  
  93. Description:  Replaces a cluster in a table. If the new cluster size is equal to or smaller than the original cluster size, the cluster is written in the same location in the data file. The cluster keeps the same cluster ID. If the new cluster size is greater than the old cluster size, the cluster is written in the next available space. The cluster will then receive a new cluster ID and the original cluster flagged as deleted. If the old cluster is deleted or the cluster ID is invalid,a 窶彡luster does not exist窶 error is returned. Clusters may not be replaced in query mode else a mode (4) error is returned. 
  94.  
  95.  If an Old Key Values list is provided, the appropriate key-cluster associations are deleted. If any of the keys do not exist, a 窶彡luster does not exist窶 (10) error is returned.
  96.  
  97.  If a New Key Values list is provided, the appropriate key-cluster associations are created. Key values are specified in sorted order of key names. If a key is defined as unique and a key value already exists for that key, a 窶彡luster already exists窶 error is returned. If NULL is specified as a key value it will be ignored. If an error is returned, the datafile will not be changed. 
  98.  
  99.  
  100. _________________________________________________
  101. ツ 
  102.                                            cluster-undelete      *497*
  103.  
  104.  
  105. Input names: Table ID; Cluster ID; [ Key Values]
  106.  
  107. Input types: integer; integer; [list]
  108.  
  109. Output types: integer
  110.  
  111. Description:  Flags a deleted cluster as valid. The cluster is then accessible to other Prograph datafile primitives. If a cluster is already valid, then a 窶彡luster already exists窶 error is returned. If the cluster ID does not point to a cluster, then a 窶彡luster does not exist窶 (10) error is returned. Clusters may not be undeleted in query mode else a mode (4) error is returned.
  112.  
  113.  If a Key Values list is provided, the appropriate key-cluster associations are restored. Key values are specified in sorted order of key names. If a key is defined as unique and a key value already exists for that key, a 窶彡luster already exists窶 error is returned. If NULL is specified as a key value it is ignored.
  114.  
  115. Note: cluster-undelete is only guaranteed to undelete everything, including keys, if it is used immediately after  a call to the cluster-delete primitive.
  116.  
  117.  
  118. _________________________________________________
  119. ツ 
  120.                                            cluster-unlock     *498*
  121.  
  122.  
  123. Input types: integer; integer
  124.  
  125. Output types: integer
  126.  
  127. Description:  Allows other applications using the data file to read, replace, or delete a previously locked cluster. Clusters may only be unlocked in share mode else a mode (4) error is returned.
  128.  
  129. Note: If unlocking a replaced cluster, unlock using the old cluster ID窶馬ot the new cluster ID.
  130.  
  131.  
  132. _________________________________________________
  133. ツ 
  134.                                           cluster-write     *498*
  135.  
  136.  
  137. Input names: Table ID; Cluster Value; [Key Values]
  138.  
  139. Input types: integer; any; [list]
  140.  
  141. Output types: integer; integer
  142.  
  143. Description:  Writes a cluster into a table. The cluster is written at the next available space in the file. A mode error (4) will be returned if an attempt is made to write a cluster in query mode. If a Key Values list is provided, the appropriate key-cluster associations are created. Key values are specified in sorted order of key names. If a key is defined as unique and a key value already exists for that key, a 窶彡luster already exists窶 error is returned. If NULL is specified as a key value it will be ignored. If an error is returned, the datafile will not be changed.
  144.  
  145. ツ 
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161. _________________________________________________
  162. ツ 
  163.                                         db-backup     *499*
  164.  
  165.  
  166. Input names: Name; [Volume]
  167.  
  168. Input types: string; [integer]
  169.  
  170. Output types: integer
  171.  
  172. Description:  Copies the specified datafile窶冱 files. These copies will be prefixed with 窶呂opy of窶™ and truncated to 31 characters. The volume reference number is optional. All paths to the datafile must be closed.
  173.  
  174.  
  175. _________________________________________________
  176. ツ 
  177.                                 db-close      *500*
  178.  
  179.  
  180. Input types: integer
  181.  
  182. Output types: integer
  183.  
  184. Description:  Closes an open datafile. db-close will also close any table or key opened using the specified Database ID. If the specified datafile path is the last path open on the datafile, the file will also be closed.
  185.  
  186.  
  187. _________________________________________________
  188. ツ 
  189.                                db-compact     *500*
  190.  
  191.  
  192. Input types: integer
  193.  
  194. Output types: integer
  195.  
  196. Description:  Removes space occupied by deleted clusters. Because compaction relocates clusters, it may change cluster IDs. Compaction should never be performed on datafiles that use cluster IDs for long term cluster access (as in a hard-link datafile).
  197.  
  198. Note :  db-compact uses a scratch file during compaction. Compaction requires free space equal to the size of the key file.
  199.  
  200.  
  201. _________________________________________________
  202. ツ 
  203.                                     db-delete      *501*
  204.  
  205.  
  206. Input names: Name; [Volume]
  207.  
  208. Input types: string; [integer]
  209.  
  210. Output types: integer
  211.  
  212. Description:  Deletes the files associated with the specified datafile. The volume reference number is optional. All paths to the datafile must be closed since they will no longer be valid.
  213.  
  214.  
  215. _________________________________________________
  216. ツ 
  217.                                  db-flush      *501*
  218.  
  219.  
  220. Input types: integer
  221.  
  222. Output types: integer
  223.  
  224. Description:  Writes out all buffered data (data stored in RAM but not yet written out to disk) to an open datafile. Periodic flushing will improve the recoverability of a datafile after a system crash. (This is only necessary in update mode窶敗hare mode always flushes between operations.)
  225.  
  226.  
  227. _________________________________________________
  228. ツ 
  229.                                       db-get-flush    *501*
  230.  
  231.  
  232. Input types: integer
  233.  
  234. Output types: integer; boolean
  235.  
  236. Description: Returns the auto-flush setting of the datafile.
  237.  
  238.  
  239. _________________________________________________
  240. ツ 
  241.                                                           db-info      *502*
  242.  
  243.  
  244.  
  245. Input types: integer
  246.  
  247. Output types: integer; integer; integer; integer; integer; integer
  248.  
  249. Description:  Returns statistical information about an open datafile. Size is the total number of bytes in the datafile. ValidCount is the number of valid clusters. ValidSize is the number of bytes used in valid clusters. DeleteCount is the number of deleted clusters. DeleteSize is the number of bytes used in deleted clusters. Since Size also includes header, map and key information, ValidSize plus DeleteSize will not equal Size. 
  250.  
  251.  
  252. _________________________________________________
  253. ツ 
  254.                                 db-list      *502*
  255.  
  256.  
  257. Output types: integer; list
  258.  
  259. Description:  Returns a list of names of all open datafiles for an application. (The order is the order of opening, with oldest first.)
  260.  
  261.  
  262. _________________________________________________
  263. ツ 
  264.                                db-new     *503*
  265.  
  266.  
  267. Input names:    Name; [Volume; [Creator ; File Type]]    
  268.  
  269. Input types: string; [integer; [integer; integer]]
  270.  
  271. Output types: integer; integer
  272.  
  273. Description:  Creates a new datafile and opens it in update mode. The specified name (maximum of 26 characters) will be the name of the datafile (and of its associated data file). A volume reference number, creator type and file type may be provided. db-new returns a datafile path reference identifier to be used by other Prograph datafile primitives.
  274.  
  275. ツ 
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287. _________________________________________________
  288. ツ 
  289.                                  db-open      *504*
  290.  
  291.  
  292. Input names:    Mode; Name; [Volume]    
  293.  
  294. Input types: string; string; [integer]
  295.  
  296. Output types: integer; integer
  297.  
  298. Description:  Opens an existing datafile. Mode must be either 窶徠uery窶, 窶忖pdate窶 or 窶徭hare窶. Name is the name of the datafile. Volume reference number is optional. Each new call will generate a different datafile path, so that an application can perform independent operations on the same datafile. Each open path on a datafile must be in the same mode.
  299.  
  300. ツ 
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311. _________________________________________________
  312. ツ 
  313.                                   db-rename      *504*
  314.  
  315.   
  316. Input names:    OldName; NewName; [Volume]
  317.  
  318. Input types:    string; string; [integer]
  319.  
  320. Output types:    integer
  321.  
  322. Description:  Renames the datafile from OldName to NewName. The volume reference number is optional. All paths to the datafile should be closed.
  323.  
  324.  
  325. _________________________________________________
  326. ツ 
  327.  
  328.                                     db-set-flush     *505*
  329.  
  330. Input types: integer; boolean
  331.  
  332. Output types: integer
  333.  
  334. Description: Turns auto-flush on and off for that datafile.  When auto-flush is on, the datafile and its key file are written to disk after every change.
  335.  
  336.  
  337. _________________________________________________
  338. ツ                            db-shutdown     *505*
  339.  
  340.  
  341. Description:  Performs a blanket close of all open keys, tables and datafiles. All space for internal tables is released until the next datafile is opened.
  342.  
  343.  
  344. _________________________________________________
  345. ツ 
  346.                    db-wait     *505*
  347.  
  348.  
  349. Input types: integer
  350.  
  351. Description:  Allows the user to specify how long to wait for a busy shared file to be released (5 second default). This is referred to as time out in some contexts.
  352.  
  353.  
  354. _________________________________________________
  355. ツ 
  356.                               key-close      *505*
  357.  
  358.  
  359. Input types: integer
  360.  
  361. Output types: integer
  362.  
  363. Description:  Closes an open key.
  364.  
  365.  
  366. _________________________________________________
  367. ツ 
  368.                                key-delete      *506*
  369.  
  370.  
  371. Input types: integer; string
  372.  
  373. Output types: integer
  374.  
  375. Description:  Deletes a key from a table. Key-cluster associations for the specified key are discarded. Keys may only be deleted in update mode. If the key does not exist, or the datafile is not opened in update mode, a non-zero error number will be returned.
  376.  
  377. NOTE:  Key deletions do not take effect until the table is reopened. 
  378.  
  379.  
  380. _________________________________________________
  381. ツ 
  382.                           key-find     *506*
  383.  
  384.  
  385. Input types: integer; simple
  386.  
  387. Output types: integer
  388.  
  389. Description:  Positions a key path at the first cluster greater than or equal to the key value. If the cluster is not equal to the key value, a 窶彡luster not found窶 (10) error is returned.
  390.  
  391.  
  392. _________________________________________________
  393. ツ 
  394.                                   key-first     *506*
  395.  
  396.  
  397. Input types: integer
  398.  
  399. Output types: integer
  400.  
  401. Description:  Positions the key path to the least cluster in the table. A 窶彡luster not found窶 (10) error is returned if the table is empty.
  402.  
  403.  
  404. _________________________________________________
  405. ツ 
  406.                                key-info     *507*
  407.  
  408.  
  409. Input types: integer
  410.  
  411. Output types: integer; list
  412.  
  413. Description:  Returns the list of option strings associated with an open key.
  414.  
  415.  
  416. _________________________________________________
  417. ツ 
  418.                              key-last     *507*
  419.  
  420.  
  421. Input types: integer
  422.  
  423. Output types: integer
  424.  
  425. Description:  Positions the key path to the greatest cluster in the table. A 窶彡luster not found窶 (10) error is returned if the table is empty.
  426.  
  427.  
  428. _________________________________________________
  429. ツ 
  430.                              key-list     *507*
  431.  
  432.  
  433. Input types: integer
  434.  
  435. Output types: integer; list
  436.  
  437. Description:  Returns a sorted list of names of all keys in the specified table.
  438.  
  439.  
  440. _________________________________________________
  441. ツ 
  442.                              key-new     *508*
  443.  
  444.  
  445. Input names: Table ID; Name; [Options]
  446.  
  447. Input types: integer; string; [list]
  448.  
  449. Output types: integer; integer
  450.  
  451. Description:  Creates and opens a new key. You supply an open table path and the name (maximum 127 characters) of the new key. Provide a list of option strings if you wish to use key options other than the defaults. key-new returns a key path reference identifier. Keys may only be created in update mode. If the key already exists, or the datafile is not opened in update mode, an  error (7 or 4 respectively) is returned.
  452.  
  453. NOTE:  New keys do not take effect until the table is reopened.
  454.  
  455. ツ 
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467. _________________________________________________
  468. ツ  
  469.                             key-next     *508*
  470.  
  471.  
  472. Input types: integer
  473.  
  474. Output types: integer
  475.  
  476. Description:  Positions the key path to the next cluster in the table. A 窶彡luster not found窶 (10) error is returned if the end of the table is reached.
  477.  
  478.  
  479. _________________________________________________
  480. ツ 
  481.                              key-open     *509*
  482.  
  483.  
  484. Input types: integer; string
  485.  
  486. Output types: integer; integer
  487.  
  488. Description:  Opens an existing key, given an open table path and the name of the existing key. key-open returns a key path reference identifier. Each call will return a new path. The key path is initially positioned at the least cluster (first cluster in key窶冱 ordering) in the table. If the key doesn窶冲 exist an error (8) is returned.
  489.  
  490. ツ 
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502. _________________________________________________
  503. ツ  
  504.                                       key-previous    *509*
  505.  
  506.  
  507. Input types: integer
  508.  
  509. Output types: integer
  510.  
  511. Description:  Positions the key path to the previous cluster in the table. A 窶彡luster not found窶 (10) error is returned if the beginning of the table is reached. The key can not be positioned prior to the first cluster of the table.
  512.  
  513.  
  514. _________________________________________________
  515. ツ 
  516.                              key-read     *510*
  517.  
  518.  
  519. Input names: Key ID; [Key Value]
  520.  
  521. Input types: integer; [simple]
  522.  
  523. Output types: integer; any
  524. Description:  If key value is not specified, the cluster pointed to by the key path is returned. If key value is specified, key-read reads the first cluster having a key equal to the key value. A 窶從o cluster exists窶 error is returned if there is no such cluster. The key path is positioned at the first cluster greater than or equal to the key value. 窶廸ame in class map窶 error may be returned.
  525.  
  526. ツ 
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536. _________________________________________________
  537. ツ  
  538.                                                   key-rename     *510*
  539.  
  540.  
  541. Input types:    integer; string; string
  542.  
  543. Output types: integer
  544.  
  545. Description:  Changes the name of a key. Keys may only be renamed in update mode. 窶廳ey does not exist窶, 窶很ey already exists窶, and mode errors may be returned.
  546. NOTE:  A renamed key does not take effect until the table is reopened.
  547.  
  548.  
  549. _________________________________________________
  550. ツ 
  551.                                      key-value      *511*
  552.  
  553.  
  554. Input types: integer
  555.  
  556. Output types: integer; simple; integer
  557.  
  558. Description:  Returns the current key value and cluster ID of the cluster pointed to by the specified key path. A 窶彡luster not found窶 (10) error is returned if the key points off the end of the table.
  559.  
  560. ツ 
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568. _________________________________________________
  569. ツ 
  570.  
  571.                                    table-close      *511*
  572.  
  573.  
  574. Input types: integer
  575.  
  576. Output types: integer
  577.  
  578. Description:  Closes an open table. table-close will also close any keys opened using the specified Table ID.
  579.  
  580.  
  581. _________________________________________________
  582. ツ 
  583.                                             table-delete      *512*
  584.  
  585.  
  586. Input types:    integer; string
  587.  
  588. Output types: integer
  589.  
  590. Description:  Deletes a table from a datafile. table-delete also deletes all clusters in the table and the set of keys associated with the table. Tables may only be deleted in update mode. All open paths to the table must be closed. If the table does not exist or the datafile mode is not update, a non-zero error number will be returned.
  591.  
  592.  
  593. _________________________________________________
  594. ツ 
  595.                                                 table-export    *512*
  596.  
  597.  
  598. Input names: Key ID; Name; [Volume]
  599.  
  600. Input types: integer; string; [integer]
  601.  
  602. Output types: integer; integer; integer
  603.  
  604. Description:  Exports data to a text file so it can be used by a non-Prograph application. Name (with optional volume reference number) is the name of a text file containing records separated by carriage returns. Only lists and instances can be written as records. Each record will contain several fields separated by tabs. The values of attributes can only be boolean, integer, real or string. The records are written out in the order of the specified key. 
  605.  GoodCount is the number of acceptable records. BadCount is the number of rejected records.
  606.  
  607.  
  608. _________________________________________________
  609. ツ 
  610.                                                 table-import    *513*
  611.  
  612.  
  613. Input names: Table ID; ColumnList; Name; [Volume]
  614.  
  615. Input types: integer; list; string; [integer]
  616.  
  617. Output types: integer; integer; integer 
  618.  
  619. Description:  Imports data from a non-Prograph application into a Prograph datafile table. Name (with optional volume reference number) is the name of a text file containing records separated by carriage returns, with each record containing several fields separated by tabs. The values of fields can only be boolean, integer, real or string. The field size is limited to 255 characters.
  620.  
  621.  If ColumnList is NULL, each record is read in as an instance of the class whose name is the same as the table. The keys are determined by matching the key names with the names of attributes of the class. 
  622.  
  623.  If ColumnList is non-NULL, it must be a list of integers corresponding to columns (fields) containing the key values (keys are given in sorted order of key names). Each record is read as a list. For example, if there are four fields in the records being read in, and fields 1 and 3 have keys 窶廬D窶 and 窶廣rtist窶 respectively associated with them, the value of ColumnList should be (3 1)
  624.  
  625.  GoodCount is the number of records that were acceptable. BadCount is the number of records that were rejected.
  626.  
  627.  Importing into a table such that each cluster will be an instance of class videos:
  628. ツ 
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  Importing into a table such that each cluster will be a list, with elements of the list corresponding to fields of the table being imported:
  637. ツ 
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646. _________________________________________________
  647. ツ  
  648.                                   table-info    *514*
  649.  
  650.  
  651. Input types: integer
  652.  
  653. Output types: integer; integer
  654.  
  655. Description:  Returns the number of valid clusters stored in the specified table.
  656.  
  657.  
  658. _________________________________________________
  659. ツ 
  660.                                     table-list     *514*
  661.  
  662.  
  663. Input types: integer
  664.  
  665. Output types: integer; list
  666.  
  667. Description:  Returns a list of names of all the tables in the specified datafile, in sorted order.
  668.  
  669.  
  670. _________________________________________________
  671. ツ 
  672.                                        table-new     *515*
  673.  
  674.  
  675. Input types: integer; string
  676.  
  677. Output types: integer; integer
  678.  
  679. Description:  Creates and opens a new table of clusters. The user supplies an open datafile path and the name (maximum of 127 characters) of the new table. table-new returns a table path identifier. Tables may only be created in update mode. If the table already exists, or if the datafile open mode is not update, a non-zero error number will be returned.
  680. ツ 
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687. _________________________________________________
  688. ツ    
  689.  
  690.                                      table-open     *515*
  691.  
  692.  
  693. Input types: integer; string
  694.  
  695. Output types: integer; integer
  696.  
  697. Description:  Opens an existing table of clusters. The user supplies an open datafile path and the name of the existing table. table-open returns a table path identifier. Each call will open a new path. If a table of the given name does not exist, a non-zero error number will be returned.
  698. ツ 
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710. _________________________________________________
  711. ツ  
  712.                                                     table-rename    *516*
  713.  
  714.  
  715. Input types: integer; string; string
  716.  
  717. Output types: integer
  718.  
  719. Description:  Changes the name of a table. Tables may only be renamed in update mode. All open paths to the table must be closed. If the table does not exist or the database mode is not update, a non-zero error number will be returned.
  720.